﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Open_MUD.Kernel;

namespace Open_MUD.Mudlib.lib.Loc.Capas
{
    class CapaGEO:CapaGIS
    {
        private readonly static Color C_OceanoProfundo = Color.FromArgb(10, 22, 45);
        private readonly static Color C_Oceano = Color.FromArgb(17, 35, 71);
        private readonly static Color C_Costa = Color.FromArgb(33, 66, 132);
        private readonly static Color C_Playa = Color.FromArgb(232, 214, 158);
        private readonly static Color C_Pradera = Color.FromArgb(20, 105, 13);
        private readonly static Color C_Bosque = Color.FromArgb(5, 54, 7);
        private readonly static Color C_BosqueNevado = Color.FromArgb(106, 173, 145);
        private readonly static Color C_Tundra = Color.FromArgb(152, 197, 197);
        private readonly static Color C_DesiertoHelado = Color.FromArgb(226, 232, 242);
        private readonly static Color C_Montaña = Color.FromArgb(72, 85, 87);
        private readonly static Color C_Escarpado = Color.FromArgb(26, 23, 22);
        private readonly static Color C_Estepa = Color.FromArgb(183, 161, 95);
        private readonly static Color C_Desierto = Color.FromArgb(208, 204, 150);
        private readonly static Color C_Dunas = Color.FromArgb(234, 231, 188);
        private readonly static Color C_Rio = Color.FromArgb(42, 149, 143);
        private readonly static Color C_Lago = Color.FromArgb(17, 66, 141);

        public OpenMUD.Mudlib.lib.Loc.Room.Bioma DameBioma(int x, int y)
        {
            Color bioma = DameColor(x, y);            
            if ( bioma == C_OceanoProfundo ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.OceanoProfundo;
            if ( bioma == C_Oceano ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Oceano;
            if ( bioma == C_Costa ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Costa;
            if ( bioma == C_Playa ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Playa; 
            if ( bioma == C_Pradera ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Pradera;
            if ( bioma == C_Bosque ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Bosque; 
            if ( bioma == C_BosqueNevado ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.BosqueNevado; 
            if ( bioma == C_Tundra ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Tundra; 
            if ( bioma == C_DesiertoHelado ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.DesiertoHelado; 
            if ( bioma == C_Montaña ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Montaña; 
            if ( bioma == C_Escarpado ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Escarpado; 
            if ( bioma == C_Estepa ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Estepa; 
            if ( bioma == C_Desierto ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Desierto; 
            if ( bioma == C_Dunas ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Dunas; 
            if ( bioma == C_Rio ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Rio; 
            if ( bioma == C_Lago ) return OpenMUD.Mudlib.lib.Loc.Room.Bioma.Lago;
            throw new MudException("Mapa mal formado");
        }
    }
}
